Repository navigation
fix(desktop): enable workspace drag reordering in collapsed v2 sidebar - #5871
Merged
Merged
Conversation
The collapsed sidebar rendered workspace icons as plain items with no drag wiring, while the expanded sidebar used useSidebarDnd. Wire the same DnD hook into the collapsed project content so collapsed workspace icons are sortable, matching v1 behavior. Cross-section moves persist through the same commit path as expanded mode. Claude-Session: https://claude.ai/code/session_01YRQUW3p84JVMXjjHp2sBs2
Contributor
📝 WalkthroughWalkthroughThe collapsed project rail now receives project children, derives workspace items through ChangesCollapsed sidebar drag-and-drop
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ProjectSection
participant CollapsedProjectContent
participant SidebarDnd
participant SortableWorkspace
ProjectSection->>CollapsedProjectContent: pass projectId and projectChildren
CollapsedProjectContent->>SidebarDnd: derive flat workspace items
CollapsedProjectContent->>SortableWorkspace: render workspace with sortableId
SortableWorkspace->>SidebarDnd: submit sortable drag interactions
SidebarDnd->>SidebarDnd: normalize pinned workspaces before persistence
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The sidebar data builder always pins the local main workspace first, but useSidebarDnd accepted drops that placed items above it. The optimistic order looked fine while mounted (the rebuild produced the same id sequence as before the drag, so the fingerprint sync never fired), then silently reverted when the sidebar collapsed/expanded and the component remounted. Normalize drop results so pinned local main workspaces stay first — the optimistic order now matches what persists. Claude-Session: https://claude.ai/code/session_01YRQUW3p84JVMXjjHp2sBs2
Contributor
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Laurence-NZ
added a commit
to Laurence-NZ/superset-pwsh
that referenced
this pull request
Jul 23, 2026
…host CLI ParadevAI#5885, Cursor session labels ParadevAI#5882, open-in-IDE v2 ParadevAI#5877, collapsed sidebar DnD ParadevAI#5871, automations FK drop ParadevAI#5878) # Conflicts: # apps/desktop/src/main/lib/agent-setup/notify-hook.test.ts
Laurence-NZ
added a commit
to Laurence-NZ/superset-pwsh
that referenced
this pull request
Jul 23, 2026
…host CLI ParadevAI#5885, Cursor session labels ParadevAI#5882, open-in-IDE v2 ParadevAI#5877, collapsed sidebar DnD ParadevAI#5871, automations FK drop ParadevAI#5878) # Conflicts: # apps/desktop/src/main/lib/agent-setup/notify-hook.test.ts
This was referenced Jul 25, 2026
6 tasks done
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the v2 sidebar, workspaces could only be drag-reordered when the sidebar was expanded — the collapsed rail rendered workspace icons as plain, non-draggable items (v1 supports dragging in both states).
useSidebarDndintoDashboardSidebarCollapsedProjectContentso collapsed workspace icons are sortable via the sameDndContext/SortableContextsetup as the expanded listSortableCollapsedWorkspaceItemwrapper (mirrorsSortableWorkspaceItem) applying the sortable transform/listeners around the collapsed iconTest Plan
bun run typecheckandbun run lintpasshttps://claude.ai/code/session_01YRQUW3p84JVMXjjHp2sBs2
Summary by cubic
Enables drag-and-drop reordering of workspaces in the collapsed v2 sidebar, matching the expanded sidebar and v1 behavior. Order changes persist (including cross-section moves) and remain stable across collapse/expand.
useSidebarDndinto collapsed project content viaDndContextandSortableContextfrom@dnd-kit/core/@dnd-kit/sortable.SortableCollapsedWorkspaceItemso only workspace icons in the rail are draggable; pinned local main workspace remains non-draggable.Written for commit 6854a2f. Summary will update on new commits.
Summary by CodeRabbit